
all_source_recurse(CC_SOURCES)
# print_files(CC_SOURCES)

add_executable(chatServer ${CC_SOURCES})

target_include_directories(chatServer
    PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/app/
    ${CMAKE_CURRENT_SOURCE_DIR}/app/chat/
    ${CMAKE_CURRENT_SOURCE_DIR}/app/chat/session/
    ${CMAKE_CURRENT_SOURCE_DIR}/app/chat/room/
)

target_link_libraries(chatServer 
    boost 
    openssl 
    smtp 
    tools
    protobuf
    proto_packge
    rdhttp
)

# 把static目录下的所有文件复制到安装目录下
add_custom_command(TARGET chatServer POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy_directory
    ${CMAKE_CURRENT_SOURCE_DIR}/static
    $<TARGET_FILE_DIR:chatServer>
)
